package LuoGu;

import java.util.Scanner;

public class P1149 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int sum = 0;
        int tmp=0;

        int[] arr = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
        for (int i = 0; i <=750; i++) {
            for (int j = 0; j <= 750; j++) {
                for (int l = 0; l <= 750; l++) {
                    int sumTmp=4;

                    if (i + j == l ) {
                        if (i > 9) {
                            tmp = i;
                            while (tmp != 0) {
                                sumTmp += arr[tmp % 10];
                                tmp /= 10;
                            }
                        }else{
                            sumTmp+=arr[i];
                        }
                        if(j>9){
                            tmp = j;
                            while (tmp != 0) {
                                sumTmp += arr[tmp % 10];
                                tmp /= 10;
                            }
                        }else{
                            sumTmp+=arr[j];
                        }
                        if(l>9){
                            tmp = l;
                            while (tmp != 0) {
                                sumTmp += arr[tmp % 10];
                                tmp /= 10;
                            }
                        }else{
                            sumTmp+=arr[l];
                        }
                        if(sumTmp==N){
                            sum++;
                        }


                    }
                }
            }
        }
        System.out.print(sum);


    }
}
